package cn.cds.withyou.lib.model;

import android.database.Cursor;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;

import cn.cds.withyou.lib.Constants;

/**
 * <p> Description: </p>
 * <p/>
 * <p> Copyright: Copyright (c) 2016 </p>
 *
 * @author: Json.Lee
 * @Version: 1.0
 * @CreateTime: 1/5/2016 00:43
 */
public class ActivityDto implements Serializable {

    private String id;
    private String activityName;
    private long signupStartT;
    private long signupEndT;
    private long activityStartT;
    private long activityEndT;
    private String activityContent;
    private String activityComment;
    private String activityAddress;
    private String activityPic;
    private List<UserDto> joiner = new ArrayList<>();

    public String getActivityComment() {
        return activityComment;
    }

    public void setActivityComment(String activityComment) {
        this.activityComment = activityComment;
    }

    public String getActivityAddress() {
        return activityAddress;
    }

    public void setActivityAddress(String activityAddress) {
        this.activityAddress = activityAddress;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getActivityName() {
        return activityName;
    }

    public void setActivityName(String activityName) {
        this.activityName = activityName;
    }

    public long getSignupStartT() {
        return signupStartT;
    }

    public void setSignupStartT(long signupStartT) {
        this.signupStartT = signupStartT;
    }

    public long getSignupEndT() {
        return signupEndT;
    }

    public void setSignupEndT(long signupEndT) {
        this.signupEndT = signupEndT;
    }

    public long getActivityStartT() {
        return activityStartT;
    }

    public void setActivityStartT(long activityStartT) {
        this.activityStartT = activityStartT;
    }

    public long getActivityEndT() {
        return activityEndT;
    }

    public void setActivityEndT(long activityEndT) {
        this.activityEndT = activityEndT;
    }

    public String getActivityContent() {
        return activityContent;
    }

    public void setActivityContent(String activityContent) {
        this.activityContent = activityContent;
    }

    public String getActivityPic() {
        return activityPic;
    }

    public void setActivityPic(String activityPic) {
        this.activityPic = activityPic;
    }

    public List<UserDto> getJoiner() {
        return joiner;
    }

    public void setJoiner(List<UserDto> joiner) {
        this.joiner = joiner;
    }

    public ActivityDto () {

    }

    public ActivityDto (Cursor result) {
        id = result.getString(result.getColumnIndex(Constants._ID));
        activityName = result.getString(result.getColumnIndex(Constants.Activity._ACTIVITY_NAME));
        signupStartT = Timestamp.valueOf(result.getString(result.getColumnIndex(Constants.Activity._SIGNUP_START_TIME))).getTime();
        signupEndT = Timestamp.valueOf(result.getString(result.getColumnIndex(Constants.Activity._SIGNUP_END_TIME))).getTime();
        activityStartT = Timestamp.valueOf(result.getString(result.getColumnIndex(Constants.Activity._ACTIVITY_START_TIME))).getTime();
        activityEndT = Timestamp.valueOf(result.getString(result.getColumnIndex(Constants.Activity._ACTIVITY_END_TIME))).getTime();
        activityContent = result.getString(result.getColumnIndex(Constants.Activity._ACTIVITY_CONTENT));
        activityPic = result.getString(result.getColumnIndex(Constants.Activity._ACTIVITY_PIC));
        activityComment = result.getString(result.getColumnIndex(Constants.Activity._ACTIVITY_COMMENT));
        activityAddress = result.getString(result.getColumnIndex(Constants.Activity._ACTIVITY_ADDRESS));
    }
}
